package cn.csc.module.product.controller.admin.spu.vo;

import cn.csc.module.product.validated.Verify1;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigInteger;
import java.util.List;

/**
 * @author: 云隐
 * @Date: 2024/01/09
 **/
@ApiModel("管理后台 - spu信息创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SpuCreateDataReqV2VO extends SpuBaseV2VO {

    @NotNull(message = "商品ID不能为空", groups = {Verify1.class})
    private BigInteger id;

    @ApiModelProperty(value = "商品详情文本", required = false)
    @NotBlank(message = "商品详情不能为空")
    private String detail;

    @ApiModelProperty(value = "商品详情图片", required = false)
    //@NotBlank(message = "商品详情图片不能为空")
    private String detailImg;

    @NotNull(message = "平台类型不能为空")
    @ApiModelProperty(value = "1:重庆 2:选品", required = true)
    private Integer czType;

    @NotEmpty(message = "sku规格属性不能为空")
    @Size(min = 1, max = 30, message = "至少需要一条规格,最多30条规格")
    private List<SkuAttrCreateReqV2VO> skuAttr;

    @ApiModelProperty(value = "规格属性", required = true)
    @Size(min = 1, max = 3, message = "超过数量限制,最少两条,最多不超过3种规格")
    private List<SkuRuleAttrReqV2VO> ruleAttrs;

    @ApiModelProperty(value = "基础属性", required = true)
    private List<SpuBasicAttrReqV2VO> basicAttrs;
}
